package com.cooperate.fly.controller;

import com.baidu.ueditor.ActionEnter;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by baobao on 2016/6/3.
 */
@Controller
public class UEditorController extends BaseController {
    @RequestMapping("resources/ueditor")
    public void baiduUEditor(HttpServletRequest request, HttpServletResponse response){
        try {
            request.setCharacterEncoding("utf-8");
            response.setHeader("Content-Type", "text/html");

            String rootPath = request.getServletContext().getRealPath("/");

            response.getWriter().write(new ActionEnter(request, rootPath).exec());
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
